Add processor graceful shutdown#286
Closed
karenychen wants to merge 1 commit into
Closed
Conversation
488c7d2 to
2130c6f
Compare
2130c6f to
802a7a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Processor.Close(ctx)as terminal, idempotent shutdown for stopping receives and abandoning messages held by the processorinFlightMessagesas a small mutex-protected message map; itsclose(ctx, settler)snapshots tracked messages underRLock, abandons each with a 10-second per-message context, and forgets each message only after abandon succeedsStartand in-flight handler contexts without requiring the caller to cancel the original start contextinFlightMessages, processor close behavior, the receive-before-close abandonment ordering, abandon timeout context, and keeping failed abandons tracked for retryValidation
go test -run 'TestInFlightMessages|TestProcessorStart|TestProcessorClose' .go test ./...go test -race -run 'TestInFlightMessages|TestProcessor' .git diff --checkNotes
go test -race ./...still hits pre-existing lock renewer test issues inv2/lockrenewer_test.go; this is logged locally in.issues/019eadca-cd7a-7a63-81c4-ce36450690f1.md.